package com.only4play.demo.imserve.service;

import com.only4play.demo.imserve.model.UserContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
@Slf4j
@RequiredArgsConstructor
public class UserServiceImpl implements IUserService{

  @Override
  public Optional<UserContext> parseToken(String token) {
    if("6666".equals(token)){
      UserContext userContext = new UserContext();
      userContext.setUserId(666L);
      userContext.setUsername("李四");
      return Optional.of(userContext);
    }else {
      return Optional.empty();
    }
  }
}
